void main(List<String> args) {
    List goodsList = [
    {"id": 1, "price": 22.68, "count": 3, "goods_name": "西瓜", "selectd": true},
    {"id": 2, "price": 11.99, "count": 3, "goods_name": "草莓", "selectd": true},
    {
      "id": 3,
      "price": 60.99,
      "count": 1,
      "goods_name": "车厘子",
      "selectd": false
    },
    {
      "id": 4,
      "price": 11.68,
      "count": 3,
      "goods_name": "平谷大桃",
      "selectd": false
    }
  ];
  // // 1. 计算selectd为true的商品总金额
  // double totalPrice = 0;
  // for (var item in goodsList) {
  //   if (item["selectd"]) {
  //     totalPrice += item["price"] * item["count"];
  //   }
  // }
  // print(totalPrice);

    double totalPrice = 0;
  for (int i = 0; i < goodsList.length; i++) {
    // 是否选中
    if (goodsList[i]['selectd']) {
      // 计算选中商品的金额
      totalPrice += goodsList[i]['price'] * goodsList[i]['count'];
    }
  }

 

}